package com.haidao.admin.component.entity;

import com.haidao.admin.component.entity.vo.ReportRecordVo;
import com.opencsv.bean.CsvBindByName;
import jakarta.persistence.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import java.util.Objects;

@Entity
@Table(name = "report_app_info")
public class ReportAppInfo extends ReportRecordVo {
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    @Column(name = "id")
    private int id;
    @Basic
    @CsvBindByName(column = "APP标识")
    @Column(name = "app_id")
    private String appId;
    @Basic
    @CsvBindByName(column = "应用包名")
    @Column(name = "pkg_name")
    private String pkgName;
    @Basic
    @CsvBindByName(column = "应用名称")
    @Column(name = "name")
    private String name;
    @Basic
    @CsvBindByName(column = "版本号")
    @Column(name = "version")
    private String version;
    @Basic
    @CsvBindByName(column = "APP类型")
    @Column(name = "app_type")
    private int appType;
    @Basic
    @CsvBindByName(column = "应用状态")
    @Column(name = "status")
    private int status;
    @Basic
    @CsvBindByName(column = "应用安装包大小")
    @Column(name = "app_file_size")
    private long appFileSize;

    @Basic
    @CsvBindByName(column = "发布范围")
    @Column(name = "publish_scope")
    private String publishScope;

    @Basic
    @CsvBindByName(column = "开发商")
    @Column(name = "vendor")
    private String vendor;

    @Basic
    @CsvBindByName(column = "应用下载地址")
    @Column(name = "app_file_url")
    private String appFileUrl;

    @Basic
    @CsvBindByName(column = "应用描述")
    @Column(name = "description")
    private String description;

    @Basic
    @CsvBindByName(column = "应用图标")
    @Column(name = "logo")
    private String logo;

    @Basic
    @CsvBindByName(column = "组织机构名称")
    @Column(name = "org_name")
    private String orgName;

    @Basic
    @CsvBindByName(column = "创建时间")
    @CreatedDate
    @Column(name = "create_time")
    private Long createTime;

    @Basic
    @CsvBindByName(column = "更新时间")
    @LastModifiedDate
    @Column(name = "update_time")
    private Long updateTime;

    @Basic
    @CsvBindByName(column = "上报结果")
    @Column(name = "report_state")
    private byte reportState;

    @Basic
    @CsvBindByName(column = "记录上报类型")
    @Column(name = "report_type")
    private String reportType;

    @Basic
    @CsvBindByName(column = "数据采集时间")
    @Column(name = "collect_time")
    private long collectTime;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getPkgName() {
        return pkgName;
    }

    public void setPkgName(String pkgName) {
        this.pkgName = pkgName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public int getAppType() {
        return appType;
    }

    public void setAppType(int appType) {
        this.appType = appType;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public long getAppFileSize() {
        return appFileSize;
    }

    public void setAppFileSize(long appFileSize) {
        this.appFileSize = appFileSize;
    }

    public String getPublishScope() {
        return publishScope;
    }

    public void setPublishScope(String publishScope) {
        this.publishScope = publishScope;
    }

    public String getVendor() {
        return vendor;
    }

    public void setVendor(String vendor) {
        this.vendor = vendor;
    }

    public String getAppFileUrl() {
        return appFileUrl;
    }

    public void setAppFileUrl(String appFileUrl) {
        this.appFileUrl = appFileUrl;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    public byte getReportState() {
        return reportState;
    }

    public void setReportState(byte reportState) {
        this.reportState = reportState;
    }

    public String getReportType() {
        return reportType;
    }

    public void setReportType(String reportType) {
        this.reportType = reportType;
    }

    public long getCollectTime() {
        return collectTime;
    }

    public void setCollectTime(long collectTime) {
        this.collectTime = collectTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ReportAppInfo that = (ReportAppInfo) o;
        return id == that.id && appType == that.appType && status == that.status && appFileSize == that.appFileSize && reportState == that.reportState && collectTime == that.collectTime && Objects.equals(appId, that.appId) && Objects.equals(pkgName, that.pkgName) && Objects.equals(name, that.name) && Objects.equals(version, that.version) && Objects.equals(publishScope, that.publishScope) && Objects.equals(vendor, that.vendor) && Objects.equals(appFileUrl, that.appFileUrl) && Objects.equals(description, that.description) && Objects.equals(logo, that.logo) && Objects.equals(orgName, that.orgName) && Objects.equals(createTime, that.createTime) && Objects.equals(updateTime, that.updateTime) && Objects.equals(reportType, that.reportType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, appId, pkgName, name, version, appType, status, appFileSize, publishScope, vendor, appFileUrl, description, logo, orgName, createTime, updateTime, reportState, reportType, collectTime);
    }
}
